import {createRouter, createWebHistory} from "vue-router";
import Login from "../views/Login.vue";
import Layout from "../views/Layout.vue";
import UserInfo from "../views/user/UserInfo.vue";
import UserList from "../views/user/UserList.vue";
import RestPassword from "../views/user/RestPassword.vue";
import TeamManage from "../views/user/TeamManage.vue";
import Index from "../views/index/Index.vue";
import home from "../views/user/home.vue";
import SummaryReview from "../views/SummaryReview.vue";
import TeamReviw from "../views/TeamReviw.vue";
import Batchlist from "../views/user/Batchlist.vue";
import Material from "../views/user/Material.vue";
import part from "../views/first/part.vue";
import Foodpart from "../views/first/allpart/Foodpart.vue";
import Outpart from "../views/first/allpart/Outpart.vue";
import SpecialTalk from "../views/first/allpart/SpecialTalk.vue";
import school from "../views/first/school.vue";
import one from "../views/first/one.vue";
import vip from "../views/money/vip.vue";
import cq from "../views/cq.vue"


// 定义路由关系
const routes = [
  {path: '/login', component: Login},  // 一级路由
  {
    path: '/',
    redirect: '/login',  // 重定向
    component: Layout,
    // 子路由
    children: [
      {path: '/index', component: Index},
      {path: '/user/list', component: UserList},
      {path: '/user/info', component: UserInfo},
      {path: '/user/resetPassword', component: RestPassword},
      {path: '/house/list', component: TeamManage},
      {path:'/user/home',component: home},
      {path: '/views/SummaryReview',component: SummaryReview},
      {path: '/views/TeamReview',component: TeamReviw},
      {path:'/user/Batchlist',component: Batchlist},
      {path: '/user/Material',component: Material},
      {path: '/first/part',component: part},
      {path: '/allpart/Foodpart',component: Foodpart},
      {path: '/allpart/Outpart',component: Outpart},
      {path: '/allpart/SpecialTalk',component: SpecialTalk},
      {path: '/first/school',component: school},
      {path: '/first/one',component: one},
      {path: '/money/vip',component: vip},
      {path: '/views/cq',component: cq}

    ]
  },
]
// 创建路由器
const router = createRouter({
  history: createWebHistory(), // 路由模式
  routes: routes
})

//导出暴露
export default router
